﻿using System;
using Ext.Net;
using System.Web;

namespace ERP.PageParrent
{
    public partial class PageParrentMain : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["login"] == null && Session["UserName"] == null)
            {
                Response.Redirect(@"../Login.aspx");
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
                Response.Cache.SetNoStore();
            }
            else
            {
                if ((bool)Session["login"] == false)
                {
                    Response.Redirect(@"../Login.aspx");
                    Response.Cache.SetCacheability(HttpCacheability.NoCache);
                    Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
                    Response.Cache.SetNoStore();
                }
            }
            if (X.IsAjaxRequest)
            {
                ResourceManager.StartupMask = null;
            }
        }
    }
}